<%--
  Created by IntelliJ IDEA.
  User: limin
  Date: 2021/8/5
  Time: 19:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">

    <title></title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">

    <link rel="stylesheet" type="text/css" href="css/edittable.css"  >
    <link rel="stylesheet" type="text/css" href="css/validate.css"  >
    <script src="js/jquery-1.8.0.js"></script>
    <script>
        $(function(){
            $("input[type=text],textarea").focus(function(){
                $(this).addClass("input_focus");
            }).blur(function(){
                $(this).removeClass("input_focus");
            });

            $(".form_btn").hover(function(){
                    $(this).css("color","red").css("background","#6FB2DB");
                },

                function(){
                    $(this).css("color","#295568").css("background","#BAD9E3");
                });
        });
    </script>
    <script>
/*        function checkroleName(){
            var reg = /^{2,15}$/
            alert("beforecheck")
            if (reg.test( $("#roleName").val())){
                alert("true1")
                return true;
            }
            alert("false1")
            return false;
        }
        $(function (){
            $("#roleName").blur(function (){
                alert("blur")
                if (checkroleName() == true){
                    alert("true")
                    $.ajax({
                        type:"post",
                        url:"RoleServlet.do",
                        data:{
                            roleName:$("#roleName").val(),
                            flag:"checkRoleName"
                        },
                        success:function (data){
                            if (data == 1){
                                $("#roleName_label").html("用户名可用")
                            }else {
                                $("#roleName_label").html("用户名不可用")
                            }
                        },
                        error:function (){
                            alert("Error")
                        }
                    })
                }else {
                    alert("false")
                    $("#roleName_label").html("用户名格式错误")
                }
            })
        })*/
    </script>
</head>

<body>
<div class="div_title">
    <div class="div_titlename"><img src="images/san_jiao.gif"><span>角色添加</span></div>
</div>
<form action="RoleServlet.do?flag=add" method="post" onsubmit="return confirm('确认提交吗')">
    <table class="edit_table">
        <tr>
            <td class="td_info">角色名称：</td>
            <td class="td_input_short"><input type="text" name="roleName" id="roleName"></td>
            <td><label class="validate_info" id="roleName_label">2-15位，非空白字符</label></td>
        </tr>
        <tr>
            <td class="td_info">角色描述：</td>
            <td class="td_input_short"><textarea rows="4" cols="27" name="des" class="txtarea"></textarea></td>
            <td></td>
        </tr>
        <tr>
            <td class="td_info"></td>
            <td><input type="submit" value="提交" class="form_btn"><input type="reset" value="重置" class="form_btn"></td>
            <td></td>
        </tr>
    </table>
</form>
${msg}
</body>
</html>
